public class Main {
    public static void main(String[] args) {


        FlyweightFactory factory=new FlyweightFactory();
        ConcreteFlyweight c1= (ConcreteFlyweight) factory.getFlyweight("Tom");
        ConcreteFlyweight c2= (ConcreteFlyweight) factory.getFlyweight("Jerry");
        ConcreteFlyweight c3= (ConcreteFlyweight) factory.getFlyweight("Bob");

        ConcreteFlyweight c4= (ConcreteFlyweight) factory.getFlyweight("Tom");


        System.out.println(c1.operation()+":\t"+c1.hashCode());
        System.out.println(c2.operation()+":\t"+c2.hashCode());
        System.out.println(c3.operation()+":\t"+c3.hashCode());
        System.out.println(c4.operation()+":\t"+c4.hashCode());
    }
}